﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kokomo.Lexical.Expressions;

namespace Kokomo.PeInspector.Reflection.Disassembly
{
	class GhostAssignment
	{
		public ISettableExpression Settable { get; private set; }
		public Expression Value { get; private set; }
		public MsilFrameInfo FrameInfo { get; private set; }

		public GhostAssignment(
			ISettableExpression settable,
			Expression value,
			MsilFrameInfo frameInfo
			)
		{
			if (settable == null) throw new ArgumentNullException("settable");
			if (value == null) throw new ArgumentNullException("value");
			if (frameInfo == null) throw new ArgumentNullException("frameInfo");

			this.Settable = settable;
			this.Value = value;
			this.FrameInfo = frameInfo;
		}

		public override string ToString()
		{
			return string.Format("{0} = {1}", this.Settable, this.Value);
		}
	}
}
